

//设置html根目录字体大小
require(['jquery','../modules/pageSize'],function($,pageSetSize){
    setRootFontSize(pageSetSize);
})

//地址列表选择、删除效果
require(['jquery','../modules/popup'],function($,popup){
    $('.address-list .choice').on('click',function(){
        $(this).toggleClass('active').parents('li').siblings().find('.choice').removeClass('active');
    })

    $('.top').on('click',function () {
        $_this = $(this);
        $.ajax({
            url:'/Home/Address/changeAddress'+getFixedExtraUrl(),
            type:'post',
            data:{'addr':$_this.data('id')},
            dataType:'json',
            success:function (data) {
                if(data['status']==1){
                    window.location.href=data.url;
                }
            },
            error:function (err) {
                popup.alertPopup('参数错误');
                //window.location.reload();
            }
        })
    })

    $('.address-list .delete').on('click',function(){
        $(this).parents('li').remove();
    })
})